home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume10 / spider / patch2 next >
Encoding:
Internet Message Format  |  1990-12-08  |  47.7 KB

  1. Path: uunet!decwrl!sun-barr!newstop!exodus!appserv!kimba
  2. From: hvr@kimba (Heather Rose)
  3. Newsgroups: comp.sources.x
  4. Subject: v10i077: spider, Patch2, Part01/01
  5. Message-ID: <315@appserv.Eng.Sun.COM>
  6. Date: 20 Nov 90 22:57:07 GMT
  7. References: <csx-10i077:spider@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 1758
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: Heather Rose <hvr@kimba>
  13. Posting-number: Volume 10, Issue 77
  14. Archive-name: spider/patch2
  15. Patch-To: spider: Volume 7, Issue 4-13
  16.  
  17. *** README    Mon Apr 30 20:04:34 1990
  18. --- ../1.1/README    Mon Nov 19 21:05:25 1990
  19. ***************
  20. *** 4,9 ****
  21. --- 4,15 ----
  22.       fixed bug, "f" will use the text field then selection for information.
  23.       added, patch_level variable to version.c file.
  24.   
  25. + Patch level 2:
  26. +     added advice for choosing a move.
  27. +     added "squish" feature for packing contiguous cards of same suit.
  28. +     added looking in common places in XView for help files if not found.
  29. +     bumped version number to 1.1 from 1.0.1.
  30.   Spider is a challenging double decked solitaire game.  Unlike most
  31.   soilitaire games, skill is just as important as luck.
  32.   
  33. ***************
  34. *** 42,48 ****
  35.   Spider has been tested on the following:
  36.   
  37.   Hosts:
  38. !     Sun 3 & 4 running 4.0.x
  39.       Solbourne 5 running 4.0x
  40.       Decstation 3100 Ultrix 3.1
  41.       Decstation 3100 running OSF/1
  42. --- 48,54 ----
  43.   Spider has been tested on the following:
  44.   
  45.   Hosts:
  46. !     Sun 3 & 4 running 4.0.x, 4.1.x
  47.       Solbourne 5 running 4.0x
  48.       Decstation 3100 Ultrix 3.1
  49.       Decstation 3100 running OSF/1
  50. ***************
  51. *** 83,89 ****
  52.   -resource_file.  These allow you to have instances of the Spider tool
  53.   which resources apply to and allow one to use a different resource
  54.   file than the default.  The default resource file for the XView version
  55. ! is $HOME/.spiderrc.  The spider.info file has more information on 
  56.   resources when you prompt it for spot help.
  57.   
  58.   Please send any bugs or comments about the XView front end to:
  59. --- 89,95 ----
  60.   -resource_file.  These allow you to have instances of the Spider tool
  61.   which resources apply to and allow one to use a different resource
  62.   file than the default.  The default resource file for the XView version
  63. ! is $HOME/.Xdefaults.  The spider.info file has more information on 
  64.   resources when you prompt it for spot help.
  65.   
  66.   Please send any bugs or comments about the XView front end to:
  67.  
  68. *** defs.h    Mon Apr 30 18:58:04 1990
  69. --- ../1.1/defs.h    Tue Nov 13 18:37:16 1990
  70. ***************
  71. *** 184,190 ****
  72.   
  73.   #define    STACK_WIDTH    (CARD_WIDTH + 10)
  74.   #define    STACK_LOC_X(i)    ((STACK_INDEX(i) * STACK_WIDTH) + CARD_INSET_X)
  75. ! #define    STACK_LOC_Y    (CARD_HEIGHT + 4 * CARD_INSET_Y)
  76.   
  77.   #define    PILE_WIDTH    STACK_WIDTH
  78.   #define    PILE_INSET_X    (STACK_WIDTH + CARD_INSET_X + CARD_WIDTH)
  79. --- 184,190 ----
  80.   
  81.   #define    STACK_WIDTH    (CARD_WIDTH + 10)
  82.   #define    STACK_LOC_X(i)    ((STACK_INDEX(i) * STACK_WIDTH) + CARD_INSET_X)
  83. ! #define    STACK_LOC_Y    (CARD_HEIGHT + 3 * CARD_INSET_Y)
  84.   
  85.   #define    PILE_WIDTH    STACK_WIDTH
  86.   #define    PILE_INSET_X    (STACK_WIDTH + CARD_INSET_X + CARD_WIDTH)
  87.  
  88. *** events.c    Mon Apr 30 19:00:35 1990
  89. --- ../1.1/events.c    Mon Jul 23 19:22:41 1990
  90. ***************
  91. *** 6,12 ****
  92.    *
  93.    *    See copyright.h for the terms of the copyright.
  94.    *
  95. !  *    @(#)events.c    2.3    90/04/30
  96.    *
  97.    */
  98.   
  99. --- 6,12 ----
  100.    *
  101.    *    See copyright.h for the terms of the copyright.
  102.    *
  103. !  *    @(#)events.c    2.5    90/06/18
  104.    *
  105.    */
  106.   
  107. ***************
  108. *** 17,22 ****
  109. --- 17,24 ----
  110.   #include    "defs.h"
  111.   #include    "globals.h"
  112.   
  113. + extern int    cheat_count;
  114.   static    CardPtr        current_card = CARDNULL;
  115.   static    CardList    current_list = CARDLISTNULL;
  116.   
  117. ***************
  118. *** 77,82 ****
  119. --- 79,85 ----
  120.           button_press((XButtonPressedEvent *)xev);
  121.       } else if (xev->xany.type == ButtonRelease)    {
  122.           button_release((XButtonReleasedEvent *)xev);
  123. +         current_list = CARDLISTNULL;
  124.       } else if (xev->xany.type == KeyPress)    {
  125.           key_press((XKeyPressedEvent *)xev);
  126.       } else if (xev->xany.type == ConfigureNotify)    {
  127. ***************
  128. *** 178,185 ****
  129.           return CARDNULL;
  130.       while (tmp)    {
  131.           if (tmp->next)    {
  132. !             if ((y <= (tmp->y + list->card_delta)) &&
  133. !                 (y >= tmp->y))    {
  134.                   return (tmp);
  135.               }
  136.           } else    {
  137. --- 181,187 ----
  138.           return CARDNULL;
  139.       while (tmp)    {
  140.           if (tmp->next)    {
  141. !             if ((y <= tmp->next->y) && (y >= tmp->y))    {
  142.                   return (tmp);
  143.               }
  144.           } else    {
  145. ***************
  146. *** 214,221 ****
  147.           current_list = deck;
  148.           return;
  149.       }
  150.       if (xev->button == Button2)    {
  151. -         current_card = coords_to_card(xev->x, xev->y);
  152.           if (current_card == CARDNULL)
  153.               return;
  154.           /* ignore facedown cards */
  155. --- 216,223 ----
  156.           current_list = deck;
  157.           return;
  158.       }
  159. +     current_card = coords_to_card(xev->x, xev->y);
  160.       if (xev->button == Button2)    {
  161.           if (current_card == CARDNULL)
  162.               return;
  163.           /* ignore facedown cards */
  164. ***************
  165. *** 293,298 ****
  166. --- 295,304 ----
  167.               return;
  168.           }
  169.   #endif
  170. +         if (list_hit == current_list)    {
  171. +             best_list_move(list_hit, current_card);
  172. +             return;
  173. +         }
  174.           if ((IS_PILE(list_hit)))    {
  175.               if((current_card->rank == King) && 
  176.                   (can_move(current_card)) &&
  177. ***************
  178. *** 315,321 ****
  179.           current_card = CARDNULL;
  180.       /* try best move if the mouse wasn't moved */
  181.       } else if (list_hit == current_list)    {
  182. !         best_list_move(list_hit);
  183.       } else    {
  184.           if (IS_PILE(list_hit))    {
  185.               tmp = last_card(current_list);
  186. --- 321,327 ----
  187.           current_card = CARDNULL;
  188.       /* try best move if the mouse wasn't moved */
  189.       } else if (list_hit == current_list)    {
  190. !         best_list_move(list_hit, CARDNULL);
  191.       } else    {
  192.           if (IS_PILE(list_hit))    {
  193.               tmp = last_card(current_list);
  194. ***************
  195. *** 339,346 ****
  196.                       move_to_list(tmp, list_hit, True);
  197.                       return;
  198.                   }
  199. -                 /* only try to move the first possible move */
  200. -                 break;
  201.               }
  202.               tmp = tmp->next;
  203.           }
  204. --- 345,350 ----
  205. ***************
  206. *** 459,467 ****
  207.           if (deal_number == 0)    {
  208.               show_message("Haven't dealt yet.");
  209.           } else if (deal_number == 1)    {
  210. !             show_message("Initial deal.");
  211.           } else    {
  212. !             sprintf(buf, "Deal number %d of 5", deal_number - 1);
  213.               show_message(buf);
  214.           }
  215.           break;
  216. --- 463,474 ----
  217.           if (deal_number == 0)    {
  218.               show_message("Haven't dealt yet.");
  219.           } else if (deal_number == 1)    {
  220. !             sprintf(buf, "Initial deal; cheat count: %d",
  221. !                     cheat_count);
  222. !             show_message(buf);
  223.           } else    {
  224. !             sprintf(buf, "Deal number %d of 5; cheat count: %d",
  225. !                 deal_number - 1, cheat_count);
  226.               show_message(buf);
  227.           }
  228.           break;
  229.  
  230. *** gfx.c    Mon Apr 30 19:00:48 1990
  231. --- ../1.1/gfx.c    Mon Jul 23 19:22:43 1990
  232. ***************
  233. *** 6,12 ****
  234.    *
  235.    *    See copyright.h for the terms of the copyright.
  236.    *
  237. !  *    @(#)gfx.c    2.2    90/04/30
  238.    *
  239.    */
  240.   
  241. --- 6,12 ----
  242.    *
  243.    *    See copyright.h for the terms of the copyright.
  244.    *
  245. !  *    @(#)gfx.c    2.3    90/05/30
  246.    *
  247.    */
  248.   
  249. ***************
  250. *** 742,747 ****
  251. --- 742,748 ----
  252.           CARD_WIDTH + 1, h, False);
  253.   
  254.       tmp = card;
  255. +     /* draw outline */
  256.       if (tmp == CARDNULL)    {
  257.   #ifdef ROUND_CARDS
  258.           if (round_cards)
  259. ***************
  260. *** 757,763 ****
  261.           show_card(tmp);
  262.           tmp = tmp->next;
  263.       }
  264.   }
  265.   
  266.   /*
  267. --- 758,763 ----
  268.  
  269. *** movelog.c    Sat Apr 28 14:53:02 1990
  270. --- ../1.1/movelog.c    Sun Nov 18 16:37:56 1990
  271. ***************
  272. *** 6,12 ****
  273.    *
  274.    *    See copyright.h for the terms of the copyright.
  275.    *
  276. !  *    @(#)movelog.c    2.1    90/04/25
  277.    *
  278.    */
  279.   
  280. --- 6,12 ----
  281.    *
  282.    *    See copyright.h for the terms of the copyright.
  283.    *
  284. !  *    %W%    %E%
  285.    *
  286.    */
  287.   
  288. ***************
  289. *** 19,24 ****
  290. --- 19,27 ----
  291.   #include    <string.h>
  292.   #include    <sys/file.h>
  293.   #include    <ctype.h>
  294. + #ifdef SVR4
  295. + #include    <unistd.h>
  296. + #endif
  297.   
  298.   #define    CACHE_SIZE    50
  299.   static int    move_index = 0;
  300. ***************
  301. *** 28,33 ****
  302. --- 31,38 ----
  303.   int    deck_cache[NUM_CARDS];
  304.   int    deck_index = 0;
  305.   
  306. + extern int    cheat_count;
  307.   make_deck_cache()
  308.   {
  309.   CardPtr    tmp;
  310. ***************
  311. *** 102,107 ****
  312. --- 107,113 ----
  313.       val = move_cache[--move_index];
  314.       if (val > 11 * 11 * 14)    {
  315.           show_message("Cheater!");
  316. +         cheat_count++;
  317.           spider_bell(dpy, 0);
  318.       }
  319.       unencode(val, &from, &dest, &num_cards, &exposed);
  320. ***************
  321. *** 108,113 ****
  322. --- 114,122 ----
  323.   
  324.       if (from == 0)    {    /* undo deal */
  325.           undo_deal();
  326. +         show_message("Cheater!");
  327. +         cheat_count++;
  328. +         spider_bell(dpy, 0);
  329.       } else    {
  330.           /*
  331.            * note that cols are from 0-9, but saved as 1-10,
  332. ***************
  333. *** 585,591 ****
  334.       }
  335.   
  336.       if ((fp = fopen(fname, "w")) == NULL)    {
  337. !         (void)sprintf(buf, "Can't open output file %s.", fname);
  338.           show_message(buf);
  339.           return;
  340.       }
  341. --- 594,600 ----
  342.       }
  343.   
  344.       if ((fp = fopen(fname, "w")) == NULL)    {
  345. !         (void)sprintf(buf, "Can't open output file \"%s\".", fname);
  346.           show_message(buf);
  347.           return;
  348.       }
  349. ***************
  350. *** 655,661 ****
  351.       /* write human readable version */
  352.       write_human(fp);
  353.       (void)fclose(fp);
  354. !     (void)sprintf(buf, "Position saved to file %s.", fname);
  355.       show_message(buf);
  356.   }
  357.   
  358. --- 664,670 ----
  359.       /* write human readable version */
  360.       write_human(fp);
  361.       (void)fclose(fp);
  362. !     (void)sprintf(buf, "Position saved to file \"%s\".", fname);
  363.       show_message(buf);
  364.   }
  365.   
  366. ***************
  367. *** 706,713 ****
  368.   char    *moves;
  369.   
  370.       buf = remove_newlines(buf);
  371. !     moves = strchr(buf, '.') + 1;    /* find moves, if any */
  372. !     if (!strchr(moves, '.'))
  373.           moves = NULL;
  374.       if (restore_game(buf, moves) != 0)    {
  375.           show_message("Bogus data in selection.");
  376. --- 715,724 ----
  377.   char    *moves;
  378.   
  379.       buf = remove_newlines(buf);
  380. !     moves = strchr(buf, '.');
  381. !     if (moves)
  382. !         moves++;
  383. !     if (moves && !strchr(moves, '.'))
  384.           moves = NULL;
  385.       if (restore_game(buf, moves) != 0)    {
  386.           show_message("Bogus data in selection.");
  387. ***************
  388. *** 737,743 ****
  389.   
  390.       fname = remove_newlines(fname);
  391.       if ((fp = fopen(fname, "r")) == NULL)    {
  392. !         (void)sprintf(buf, "Can't open file %s for loading.", fname);
  393.           show_message(buf);
  394.           return;
  395.       }
  396. --- 748,755 ----
  397.   
  398.       fname = remove_newlines(fname);
  399.       if ((fp = fopen(fname, "r")) == NULL)    {
  400. !         (void)sprintf(buf, "Can't open file \"%s\" for loading.", 
  401. !                 fname);
  402.           show_message(buf);
  403.           return;
  404.       }
  405. ***************
  406. *** 765,773 ****
  407.       *++dp = '\0';
  408.   
  409.       if (restore_game(buf, buf2) == 0)    {
  410. !         (void)sprintf(buf, "Saved game %s loaded.", fname);
  411.       } else    {
  412. !         (void)sprintf(buf, "Bogus save file %s.", fname);
  413.           restart = True;
  414.       }
  415.   
  416. --- 777,785 ----
  417.       *++dp = '\0';
  418.   
  419.       if (restore_game(buf, buf2) == 0)    {
  420. !         (void)sprintf(buf, "Saved game \"%s\" loaded.", fname);
  421.       } else    {
  422. !         (void)sprintf(buf, "Bogus save file \"%s\".", fname);
  423.           restart = True;
  424.       }
  425.   
  426.  
  427. *** spider.c    Sat Apr 28 16:46:57 1990
  428. --- ../1.1/spider.c    Mon Nov 19 20:07:50 1990
  429. ***************
  430. *** 6,12 ****
  431.    *
  432.    *    See copyright.h for the terms of the copyright.
  433.    *
  434. !  *    @(#)spider.c    2.1    90/04/25
  435.    *
  436.    */
  437.   
  438. --- 6,12 ----
  439.    *
  440.    *    See copyright.h for the terms of the copyright.
  441.    *
  442. !  *    @(#)spider.c    2.3    90/06/18
  443.    *
  444.    */
  445.   
  446. ***************
  447. *** 21,26 ****
  448. --- 21,28 ----
  449.   static void    fix_coords();
  450.   
  451.   int     deltamod = 0;
  452. + Bool    squish = True;
  453. + int    cheat_count = 0;
  454.   
  455.   /*
  456.    * build all the cards, stacks, piles and the original deck
  457. ***************
  458. *** 160,165 ****
  459. --- 162,168 ----
  460.   
  461.       deal_number = 0;
  462.       restart = False;
  463. +     cheat_count = 0;
  464.   
  465.       /* reset move log */
  466.       init_cache();
  467. ***************
  468. *** 242,253 ****
  469.           old_delta = stack[i]->card_delta;
  470.           tmp = deck->cards;
  471.           remove_card(tmp);
  472.           add_card(tmp, stack[i]->cards, LOC_END, stack[i]);
  473.           if (old_delta != stack[i]->card_delta)    {
  474. -             tmp->type = Faceup;
  475.               show_list(stack[i], stack[i]->cards);
  476.           } else    {
  477. !             flip_card(tmp, Faceup);
  478.           }
  479.       }
  480.   
  481. --- 245,256 ----
  482.           old_delta = stack[i]->card_delta;
  483.           tmp = deck->cards;
  484.           remove_card(tmp);
  485. +         tmp->type = Faceup;
  486.           add_card(tmp, stack[i]->cards, LOC_END, stack[i]);
  487.           if (old_delta != stack[i]->card_delta)    {
  488.               show_list(stack[i], stack[i]->cards);
  489.           } else    {
  490. !             show_card(tmp);
  491.           }
  492.       }
  493.   
  494. ***************
  495. *** 343,348 ****
  496. --- 346,359 ----
  497.   }
  498.   
  499.   /*
  500. +  * see if cards exist, are faceup, and part of the same run
  501. +  */
  502. + #define    in_sequence(a, b)                        \
  503. +     ((a) && (b) &&                            \
  504. +         ((a)->type == Faceup) && ((b)->type == Faceup) &&    \
  505. +         ((a)->suit == (b)->suit) && ((a)->rank == (b)->rank + 1))
  506. + /*
  507.    * fix up the inter-card spacing for a stack
  508.    */
  509.   static void
  510. ***************
  511. *** 360,366 ****
  512.               if (display)
  513.                   show_list(list, list->cards);
  514.           }
  515. !         new->y = new->prev->y + list->card_delta;
  516.       } else     {
  517.           new->y = list->y;
  518.       }
  519. --- 371,383 ----
  520.               if (display)
  521.                   show_list(list, list->cards);
  522.           }
  523. !         /* runs are coallesced */
  524. !         if (squish && in_sequence(new->prev, new) && 
  525. !             in_sequence(new->prev->prev, new->prev))    {
  526. !                 new->y = new->prev->y + (list->card_delta >> 2);
  527. !         } else    {
  528. !             new->y = new->prev->y + list->card_delta;
  529. !         }
  530.       } else     {
  531.           new->y = list->y;
  532.       }
  533. ***************
  534. *** 367,372 ****
  535. --- 384,414 ----
  536.   }
  537.   
  538.   /*
  539. +  * fix up the inter-card spacing when resource value "squish" changes.
  540. +  */
  541. + void
  542. + fix_up_card_spacing()
  543. + {
  544. +     int i, maxy;
  545. +     CardPtr tmp, last;
  546. +     CardList list;
  547. +     for (i = 0; i < NUM_STACKS; i++) {
  548. +         list = stack[i];
  549. +         tmp = list->cards;
  550. +         last = last_card(list);
  551. +         maxy = last->y;
  552. +         while(tmp) {
  553. +             fix_coords(tmp, list, False);
  554. +             tmp = tmp->next;
  555. +         }
  556. +         if (maxy != last->y) {
  557. +             show_list(list, list->cards);
  558. +         }
  559. +     }
  560. + }
  561. + /*
  562.    * compute the inter-card spacing for a stack
  563.    */
  564.   void
  565. ***************
  566. *** 708,724 ****
  567.    * performs the best move for an entire sub-list
  568.    */
  569.   void
  570. ! best_list_move(list)
  571.   CardList    list;
  572.   {
  573.   CardPtr    tmp, tmp2;
  574.   CardList    best = CARDLISTNULL;
  575.   
  576. !     tmp = list->cards;
  577. !     if (tmp == CARDNULL)    {
  578. !         show_message("Empty list");
  579. !         spider_bell(dpy, 0);
  580. !         return;
  581.       }
  582.   
  583.       /*
  584. --- 750,771 ----
  585.    * performs the best move for an entire sub-list
  586.    */
  587.   void
  588. ! best_list_move(list, first_card)
  589.   CardList    list;
  590. + CardPtr        first_card;
  591.   {
  592.   CardPtr    tmp, tmp2;
  593.   CardList    best = CARDLISTNULL;
  594.   
  595. !     if (first_card != CARDNULL)    {
  596. !         tmp = first_card;
  597. !     } else    {
  598. !         tmp = list->cards;
  599. !         if (tmp == CARDNULL)    {
  600. !             show_message("Empty list");
  601. !             spider_bell(dpy, 0);
  602. !             return;
  603. !         }
  604.       }
  605.   
  606.       /*
  607. ***************
  608. *** 979,986 ****
  609.       for (tmp = list->cards; tmp; tmp = tmp->next)    {
  610.           if (tmp->type != Faceup)
  611.               continue;
  612. !         if ((!checksuit || tmp->suit == suit) && 
  613. !             tmp->rank == rank)
  614.               count++;
  615.       }
  616.       return    count;
  617. --- 1026,1041 ----
  618.       for (tmp = list->cards; tmp; tmp = tmp->next)    {
  619.           if (tmp->type != Faceup)
  620.               continue;
  621. !         /* we have a find if we asked for a suit and found it
  622. !          * OR if we don't have a suit and are looking for a free
  623. !          * card
  624. !          */
  625. !         if (tmp->rank == rank &&
  626. !             ((checksuit && tmp->suit == suit) ||
  627. !             (!checksuit && 
  628. !                 (!tmp->next ||    /* end of stack */
  629. !                 (tmp->next &&     /* free */
  630. !                     tmp->next->rank != (tmp->rank - 1))))))
  631.               count++;
  632.       }
  633.       return    count;
  634. ***************
  635. *** 1056,1062 ****
  636.           }
  637.       }
  638.   
  639. !     (void)sprintf(buf, "%s ", str);
  640.       for (i = 0; i < NUM_STACKS; i++)    {
  641.           if (num = col_locate(stack[i], suit, rank, checksuit))    {
  642.               if (found)    {
  643. --- 1111,1121 ----
  644.           }
  645.       }
  646.   
  647. !     if (checksuit)
  648. !         (void)sprintf(buf, "%s of %s ", 
  649. !             rank_name(rank), suit_name(suit));
  650. !     else
  651. !         (void)sprintf(buf, "Free %s ", rank_name(rank));
  652.       for (i = 0; i < NUM_STACKS; i++)    {
  653.           if (num = col_locate(stack[i], suit, rank, checksuit))    {
  654.               if (found)    {
  655.  
  656. *** spider.info    Mon Apr 30 20:06:15 1990
  657. --- ../1.1/spider.info    Mon Nov 19 20:37:38 1990
  658. ***************
  659. *** 81,86 ****
  660. --- 81,91 ----
  661.   
  662.   Corresponds to resource "Spider.confirm".
  663.   
  664. + :squish
  665. + If True, cards which can be moved as a group will be stacked together to save board space.  Instead of seeing K, Q, J, 10 of hearts, one would see K & 10 and just the tops of Q & J.
  666. + Corresponds to resource "Spider.squish".
  667.   :deltaMod
  668.   Specifies the interval at which to recalculate the inter-card spacing.  The default is 1, which means the card stacks are resized every time they grow or shrink when they near the bottom of the table. Setting this to a higher value will cut down on the number of redraws by limiting visibility when its unnecessary. 
  669.   
  670. ***************
  671. *** 92,107 ****
  672.   Corresponds to resource "Spider.textField".
  673.   
  674.   :helpDir
  675. ! Specifies where to look for the help files in the "Help" button.  If the new location does not have help documents, the "Help" button will be greyed out.
  676.   
  677.   Corresponds to resource "Spider.helpDir".
  678.   
  679.   :props.apply
  680. ! When pressed, "Apply" will apply all changes made to the property sheet to the running spider game as well as the current resource file as specified by the default value or the -resource_file command line option.
  681.   
  682.   :props.reset
  683.   When pressed, "Reset" will reset the changes made to the property sheet to the original values.  The values will be from the last "Apply" operation.
  684.   
  685.   :props.dismiss
  686. ! When pressed, "Dismiss" will dismiss the property sheet window.
  687.   
  688. --- 97,115 ----
  689.   Corresponds to resource "Spider.textField".
  690.   
  691.   :helpDir
  692. ! Specifies where to look for the help files in the "Help" button.  If the new location does not have help documents, the "Help" button will be greyed out.  If the help files are not found in the specified help directory, at start up time only Spider will also look for help files first in $OPENWINHOME/lib/help/spider and then in $XVIEWHOME/lib/help/spider.
  693.   
  694.   Corresponds to resource "Spider.helpDir".
  695.   
  696.   :props.apply
  697. ! When pressed, "Apply" will apply all changes made to the property sheet to the running spider game only. 
  698.   
  699. + :props.apply_save
  700. + When pressed, "Apply & Save" will apply all changes made to the property sheet to the running spider game as well as the current resource file.  If no resource file is specified by the "-resource_file" command line option, ~/.Xdefaults is used.
  701.   :props.reset
  702.   When pressed, "Reset" will reset the changes made to the property sheet to the original values.  The values will be from the last "Apply" operation.
  703.   
  704.   :props.dismiss
  705. ! When pressed, "Dismiss" will reset and dismiss the property sheet window.
  706.   
  707. *** spider.man    Sat Apr 28 16:50:06 1990
  708. --- ../1.1/spider.man    Thu Jul 26 11:57:00 1990
  709. ***************
  710. *** 1,4 ****
  711. ! .\" @(#)spider.man 2.1 90/04/27; Copyright (c) 1990 - David Lemke & Network Computing Devices Inc
  712.   .TH spider 1 "30 Jan 1990"
  713.   .SH NAME
  714.   spider \- play double deck solitaire
  715. --- 1,4 ----
  716. ! .\" @(#)spider.man 2.2 90/05/30; Copyright (c) 1990 - David Lemke & Network Computing Devices Inc
  717.   .TH spider 1 "30 Jan 1990"
  718.   .SH NAME
  719.   spider \- play double deck solitaire
  720. ***************
  721. *** 26,33 ****
  722.   .I spider
  723.   when compiled with XView has a property sheet for defining resources.
  724.   The property sheet is on the "File" menu item.  To be sure spot help is
  725. ! active, set the environment variable HELPDIR to the directory containing
  726. ! the spider.info file.
  727.   .SH OPTIONS
  728.   .TP 5
  729.   .BI \-save_file " filename"
  730. --- 26,34 ----
  731.   .I spider
  732.   when compiled with XView has a property sheet for defining resources.
  733.   The property sheet is on the "File" menu item.  To be sure spot help is
  734. ! active, set the environment variable HELPDIR for XView version 1.0.1 or
  735. ! HELPPATH for XView version 2.0 or later to the directory containing
  736. ! the spider.info file.  See spot help on the property sheet for more details.
  737.   .SH OPTIONS
  738.   .TP 5
  739.   .BI \-save_file " filename"
  740. ***************
  741. *** 62,67 ****
  742. --- 63,73 ----
  743.   they grow or shrink when when they near the bottom of the table.
  744.   Setting this to a higher value will cut down on the number of redraws
  745.   by limiting visibility when its unnecessary.
  746. + .TP 8
  747. + .B "squish" (\fPclass\fB Squish)"
  748. + Specifies whether to use a different card layout that saves on
  749. + screen space but can also be somewhat confusing.  The default
  750. + is "off".
  751.   .TP 8
  752.   .B "helpDir (\fPclass\fB HelpDir)"
  753.   Specifies where to look for the help files.
  754.  
  755. *** version.c    Tue May  1 16:09:34 1990
  756. --- ../1.1/version.c    Sun Nov 18 16:40:17 1990
  757. ***************
  758. *** 16,20 ****
  759.    * In the case below, add the line Prereq: "1.0.1" to the next patch to be
  760.    * sure patches are installed in the correct order.
  761.    */
  762. ! char    *version = "1.0.1" ;
  763.   char    *build_date = DATE;
  764. --- 16,20 ----
  765.    * In the case below, add the line Prereq: "1.0.1" to the next patch to be
  766.    * sure patches are installed in the correct order.
  767.    */
  768. ! char    *version = "1.1" ;
  769.   char    *build_date = DATE;
  770.  
  771. *** xaw_stubs.c    Mon Apr 30 19:01:36 1990
  772. --- ../1.1/xaw_stubs.c    Sun Nov 18 16:37:57 1990
  773. ***************
  774. *** 6,12 ****
  775.    *
  776.    *    See copyright.h for the terms of the copyright.
  777.    *
  778. !  *    @(#)xaw_stubs.c    2.4    90/04/30
  779.    *
  780.    */
  781.   
  782. --- 6,12 ----
  783.    *
  784.    *    See copyright.h for the terms of the copyright.
  785.    *
  786. !  *    %W%    %E%
  787.    *
  788.    */
  789.   
  790. ***************
  791. *** 156,163 ****
  792.       XtGetValues(file, args, ONE);
  793.       switch ((int) call_data)    {
  794.           case    0:
  795. !             if (fname)    {
  796.                   write_file(fname, write_confirmer);
  797.               } else    {
  798.                   show_message("Bogus filename.");
  799.               }
  800. --- 156,165 ----
  801.       XtGetValues(file, args, ONE);
  802.       switch ((int) call_data)    {
  803.           case    0:
  804. !             if (strlen(fname))    {
  805.                   write_file(fname, write_confirmer);
  806. +             } else    if (fname = get_selection()) {
  807. +                 write_file(fname, write_confirmer);
  808.               } else    {
  809.                   show_message("Bogus filename.");
  810.               }
  811. ***************
  812. *** 243,248 ****
  813. --- 245,251 ----
  814.   
  815.       table_height = ((XConfigureEvent *)xev)->height;
  816.       table_width = ((XConfigureEvent *)xev)->width;
  817. +     XClearArea(dpy, table, 0, 0, 0, 0, False);
  818.       for (i = 0; i < NUM_STACKS; i++)    {
  819.           if (stack[i])
  820.               recompute_list_deltas(stack[i]);
  821. *** xaw_ui.c    Mon Apr 30 19:01:36 1990
  822. --- ../1.1/xaw_ui.c    Mon Jul 23 19:22:39 1990
  823. ***************
  824. *** 6,12 ****
  825.    *
  826.    *    See copyright.h for the terms of the copyright.
  827.    *
  828. !  *    @(#)xaw_ui.c    2.3    90/04/30
  829.    *
  830.    */
  831.   
  832. --- 6,12 ----
  833.    *
  834.    *    See copyright.h for the terms of the copyright.
  835.    *
  836. !  *    @(#)xaw_ui.c    2.5    90/06/18
  837.    *
  838.    */
  839.   
  840. ***************
  841. *** 37,42 ****
  842. --- 37,43 ----
  843.   #ifdef ROUND_CARDS
  844.   extern Bool    round_cards;
  845.   #endif
  846. + extern Bool    squish;
  847.   extern int    deltamod;
  848.   extern char    *helpDir;
  849.   
  850. ***************
  851. *** 48,53 ****
  852. --- 49,55 ----
  853.   #ifdef ROUND_CARDS
  854.       Bool    round_cards;
  855.   #endif
  856. +     Bool    squish;
  857.       int    replayTime;
  858.       int    deltamod;
  859.       char    *helpDir;
  860. ***************
  861. *** 66,71 ****
  862. --- 68,75 ----
  863.       { "roundCards", "RoundCards", XtRBoolean, sizeof(Boolean),
  864.           offset(round_cards), XtRString, "True" },
  865.   #endif
  866. +     { "squish", "Squish", XtRBoolean, sizeof(Boolean),
  867. +         offset(squish), XtRString, "False" },
  868.       { "deltaMod", "DeltaMod", XtRInt, sizeof(int),
  869.           offset(deltamod), XtRString, "1" },
  870.       { "helpDir", "HelpDir", XtRString, sizeof(char *),
  871. ***************
  872. *** 216,221 ****
  873. --- 220,226 ----
  874.   #ifdef ROUND_CARDS
  875.       round_cards = app_resources.round_cards;
  876.   #endif
  877. +     squish = app_resources.squish;
  878.       deltamod = app_resources.deltamod;
  879.       helpDir = app_resources.helpDir;
  880.   
  881.  
  882. *** xv_stubs.c    Mon Apr 30 19:50:20 1990
  883. --- ../1.1/xv_stubs.c    Sun Nov 18 22:42:25 1990
  884. ***************
  885. *** 23,28 ****
  886. --- 23,29 ----
  887.   char    *instanceName;
  888.   char    *resourceFile;
  889.   char    *helpDir;
  890. + extern Bool squish;
  891.   
  892.   int        INSTANCE, HELPKEY;
  893.   spider_window1_objects    *spider_window1;
  894. ***************
  895. *** 295,300 ****
  896. --- 296,304 ----
  897.                   ip = (spider_window1_objects*)xv_get(item,XV_KEY_DATA,INSTANCE);
  898.           if (ip->subwindow2 == (spider_subwindow2_objects *)NULL) {
  899.               ip->subwindow2 = spider_subwindow2_objects_initialize(ip, ip->window1);
  900. +             xv_set(ip->subwindow2->window3,
  901. +                 FRAME_CMD_PUSHPIN_IN,   TRUE,
  902. +                 NULL);
  903.           }
  904.           if (!(int)xv_get(ip->subwindow2->window3, XV_SHOW)) {
  905.               xv_set(ip->subwindow2->window3, 
  906. ***************
  907. *** 411,426 ****
  908.           Xv_opaque       owner;
  909.       int        which;
  910.   {
  911. !     char buf[256];
  912.   
  913.       sprintf(buf,"%s/%s",ip->defaults->helpDir, helpfiles[which]);
  914.   
  915.       if (ip->subwindow1 == NULL) {
  916.           ip->subwindow1 = spider_subwindow1_objects_initialize(ip, ip->window1);
  917.       }
  918.       xv_set(ip->subwindow1->window2, 
  919. !         FRAME_LABEL, buf,
  920.           NULL);
  921.       xv_set(ip->subwindow1->textsw1,
  922.           TEXTSW_READ_ONLY, TRUE,
  923.           TEXTSW_FILE, buf,
  924. --- 415,434 ----
  925.           Xv_opaque       owner;
  926.       int        which;
  927.   {
  928. !     char buf[512], buf2[640];
  929.   
  930.       sprintf(buf,"%s/%s",ip->defaults->helpDir, helpfiles[which]);
  931. +     sprintf(buf2,"%s Help:  %s",ip->defaults->instanceName, buf);
  932.   
  933.       if (ip->subwindow1 == NULL) {
  934.           ip->subwindow1 = spider_subwindow1_objects_initialize(ip, ip->window1);
  935.       }
  936.       xv_set(ip->subwindow1->window2, 
  937. !         FRAME_LABEL, buf2,
  938.           NULL);
  939. +     xv_set(ip->subwindow1->categoryChoice,
  940. +         PANEL_VALUE, which,
  941. +         NULL);
  942.       xv_set(ip->subwindow1->textsw1,
  943.           TEXTSW_READ_ONLY, TRUE,
  944.           TEXTSW_FILE, buf,
  945. ***************
  946. *** 433,439 ****
  947.       } else {
  948.           wmgr_top(ip->subwindow1->window2);
  949.       }
  950. !     show_message(buf);
  951.   }
  952.   
  953.   /*
  954. --- 441,448 ----
  955.       } else {
  956.           wmgr_top(ip->subwindow1->window2);
  957.       }
  958. !     sprintf(buf2,"Viewing help file %s", buf);
  959. !     show_message(buf2);
  960.   }
  961.   
  962.   /*
  963. ***************
  964. *** 507,514 ****
  965.   }
  966.   
  967.   /*
  968. !  * Notify callback function for `button8 (Intro)', `button9 (Rules)', 
  969. !  *    `button10 (Controls)',    `button11 (Examples)', `button12 (Extras)'.
  970.    */
  971.   void
  972.   subhelp_handler(item, event)
  973. --- 516,522 ----
  974.   }
  975.   
  976.   /*
  977. !  * Notify callback function for 'categoryChoice' choice items.
  978.    */
  979.   void
  980.   subhelp_handler(item, event)
  981. ***************
  982. *** 520,526 ****
  983.       int which;
  984.       void do_spider_help();
  985.   
  986. !     which = (int) xv_get(item, XV_KEY_DATA, HELPKEY);
  987.       if (which < HELP_MIN || which >= HELP_MAX) {
  988.           sprintf(buf,"Error in show help, key = %d", which);
  989.           show_message(buf);
  990. --- 528,534 ----
  991.       int which;
  992.       void do_spider_help();
  993.   
  994. !     which = (int)xv_get(item, PANEL_VALUE);
  995.       if (which < HELP_MIN || which >= HELP_MAX) {
  996.           sprintf(buf,"Error in show help, key = %d", which);
  997.           show_message(buf);
  998. ***************
  999. *** 531,537 ****
  1000.   }
  1001.           
  1002.   /*
  1003. !  * Notify callback function for for `button14 (Done)'
  1004.    */
  1005.   void
  1006.   help_done_handler(item, event)
  1007. --- 539,545 ----
  1008.   }
  1009.           
  1010.   /*
  1011. !  * Notify callback function for for `dismissButton (Dismiss)'
  1012.    */
  1013.   void
  1014.   help_done_handler(item, event)
  1015. ***************
  1016. *** 543,549 ****
  1017.       ip = (spider_window1_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1018.           xv_set(ip->subwindow1->window2,
  1019.                   XV_SHOW,                FALSE,
  1020. !                 FRAME_CMD_PUSHPIN_IN,   FALSE,
  1021.                   0);
  1022.       xv_set(ip->subwindow1->textsw1,
  1023.           TEXTSW_FILE, NULL,
  1024. --- 551,557 ----
  1025.       ip = (spider_window1_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1026.           xv_set(ip->subwindow1->window2,
  1027.                   XV_SHOW,                FALSE,
  1028. !                 FRAME_CMD_PUSHPIN_IN,    FALSE,
  1029.                   0);
  1030.       xv_set(ip->subwindow1->textsw1,
  1031.           TEXTSW_FILE, NULL,
  1032. ***************
  1033. *** 643,654 ****
  1034.   {
  1035.           spider_window1_objects *ip;
  1036.       char buf[256];
  1037. !     int i;
  1038.       char *s;
  1039.       Bool resource_confirmer();
  1040.       extern Bool usebell, round_cards;
  1041.       extern int deltamod;
  1042.       extern void force_redraw();
  1043.   
  1044.       ip = (spider_window1_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1045.   
  1046. --- 651,663 ----
  1047.   {
  1048.           spider_window1_objects *ip;
  1049.       char buf[256];
  1050. !     int i, need_redraw=FALSE;
  1051.       char *s;
  1052.       Bool resource_confirmer();
  1053.       extern Bool usebell, round_cards;
  1054.       extern int deltamod;
  1055.       extern void force_redraw();
  1056. +     extern void fix_up_card_spacing();
  1057.   
  1058.       ip = (spider_window1_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1059.   
  1060. ***************
  1061. *** 668,674 ****
  1062.       if ((i = (int)xv_get(ip->subwindow2->choice2, PANEL_VALUE)) !=
  1063.           ip->defaults->roundCards) {
  1064.           ip->defaults->roundCards = round_cards = i;
  1065. !         force_redraw();
  1066.           sprintf(buf,"%s.%s", ip->defaults->instanceName, "roundCards");
  1067.           defaults_set_boolean(buf, ip->defaults->roundCards);
  1068.       }
  1069. --- 677,683 ----
  1070.       if ((i = (int)xv_get(ip->subwindow2->choice2, PANEL_VALUE)) !=
  1071.           ip->defaults->roundCards) {
  1072.           ip->defaults->roundCards = round_cards = i;
  1073. !         need_redraw = TRUE;
  1074.           sprintf(buf,"%s.%s", ip->defaults->instanceName, "roundCards");
  1075.           defaults_set_boolean(buf, ip->defaults->roundCards);
  1076.       }
  1077. ***************
  1078. *** 679,684 ****
  1079. --- 688,700 ----
  1080.           sprintf(buf,"%s.%s", ip->defaults->instanceName, "confirm");
  1081.           defaults_set_boolean(buf,ip->defaults->confirm);
  1082.       }
  1083. +     if ((i = (int)xv_get(ip->subwindow2->choice4, PANEL_VALUE)) !=
  1084. +             ip->defaults->squish) {
  1085. +         ip->defaults->squish = squish = i;
  1086. +         sprintf(buf,"%s.%s", ip->defaults->instanceName, "squish");
  1087. +         defaults_set_boolean(buf,ip->defaults->squish);
  1088. +         fix_up_card_spacing();
  1089. +     }
  1090.       if ((i = (int)xv_get(ip->subwindow2->slider1, PANEL_VALUE)) != 
  1091.               ip->defaults->deltaMod) {
  1092.           ip->defaults->deltaMod =  deltamod = i;
  1093. ***************
  1094. *** 708,726 ****
  1095.               xv_set(ip->button6, PANEL_INACTIVE, TRUE, 0);
  1096.           }
  1097.       }
  1098. !     /* TODO:  Use xrm directly since XView defaults currently store 
  1099. !      *        the entire contents of xrm to the resource file instead of
  1100. !      *        a select number of things 
  1101. !      */
  1102. !     if ((access(resourceFile, R_OK) == -1) || 
  1103. !         resource_confirmer()) {
  1104. !         defaults_store_db(resourceFile);
  1105. !         sprintf(buf,"Defaults saved to %s", resourceFile);
  1106. !         show_message(buf);
  1107.       } else {
  1108. !         sprintf(buf,"Defaults not saved to %s", resourceFile);
  1109. !         show_message(buf);
  1110.       }
  1111.   }
  1112.   
  1113.   /*
  1114. --- 724,762 ----
  1115.               xv_set(ip->button6, PANEL_INACTIVE, TRUE, 0);
  1116.           }
  1117.       }
  1118. !     if (need_redraw) force_redraw();
  1119. !     sprintf(buf,"Defaults saved for running tool");
  1120. !     show_message(buf);
  1121. ! }
  1122. ! /*
  1123. !  * Notify callback function for `button18 (Apply & Save)'.
  1124. !  */
  1125. ! void
  1126. ! props_apply_save_handler(item, event)
  1127. !         Panel_item      item;
  1128. !         Event           *event;
  1129. ! {
  1130. !     char buf[640];
  1131. !     props_apply_handler(item, event);
  1132. !     if (resource_confirmer()) {
  1133. !         if (access(resourceFile, R_OK) == -1) {
  1134. !             defaults_store_db(resourceFile);
  1135. !             sprintf(buf,"Defaults saved to file %s.", resourceFile);
  1136. !         } else {
  1137. !             sprintf(buf,"%s.  %s %s.",
  1138. !                 "Could not access resource file",    
  1139. !                 "Defaults NOT saved to file",
  1140. !                 resourceFile);
  1141. !             xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1142. !         }
  1143.       } else {
  1144. !         sprintf(buf,"Defaults NOT saved to file %s.", resourceFile);
  1145. !         xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1146.       }
  1147. +     show_message(buf);
  1148.   }
  1149.   
  1150.   /*
  1151. ***************
  1152. *** 745,750 ****
  1153. --- 781,792 ----
  1154.           PANEL_VALUE, ip->defaults->roundCards, 
  1155.           0);
  1156.   #endif
  1157. +     xv_set(ip->subwindow2->choice3,
  1158. +         PANEL_VALUE, ip->defaults->confirm,
  1159. +                 0);
  1160. +     xv_set(ip->subwindow2->choice4, 
  1161. +         PANEL_VALUE, ip->defaults->squish, 
  1162. +         0);
  1163.       xv_set(ip->subwindow2->slider1, 
  1164.           PANEL_VALUE, ip->defaults->deltaMod, 
  1165.           0);
  1166. ***************
  1167. *** 754,763 ****
  1168.       xv_set(ip->subwindow2->textfield2, 
  1169.           PANEL_VALUE, ip->defaults->helpDir, 
  1170.           0);
  1171.   }
  1172.   
  1173.   /*
  1174. !  * Notify callback function for `button17 (Done)'.
  1175.    */
  1176.   void
  1177.   props_done_handler(item, event)
  1178. --- 796,806 ----
  1179.       xv_set(ip->subwindow2->textfield2, 
  1180.           PANEL_VALUE, ip->defaults->helpDir, 
  1181.           0);
  1182. +     xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1183.   }
  1184.   
  1185.   /*
  1186. !  * Notify callback function for `button17 (Dismiss)'.
  1187.    */
  1188.   void
  1189.   props_done_handler(item, event)
  1190. ***************
  1191. *** 767,776 ****
  1192.       spider_window1_objects *ip;
  1193.       Xv_opaque win;
  1194.   
  1195.       ip = (spider_window1_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1196.       (void) xv_set(ip->subwindow2->window3, 
  1197.           XV_SHOW,        FALSE, 
  1198. !         FRAME_CMD_PUSHPIN_IN,    FALSE,
  1199.           0);
  1200.   }
  1201.   
  1202. --- 810,821 ----
  1203.       spider_window1_objects *ip;
  1204.       Xv_opaque win;
  1205.   
  1206. +     props_reset_handler(item, event);
  1207. +     xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, NULL);
  1208.       ip = (spider_window1_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1209.       (void) xv_set(ip->subwindow2->window3, 
  1210.           XV_SHOW,        FALSE, 
  1211. !                 FRAME_CMD_PUSHPIN_IN,    FALSE,
  1212.           0);
  1213.   }
  1214.   
  1215. *** xv_ui.c    Mon Apr 30 19:33:40 1990
  1216. --- ../1.1/xv_ui.c    Sun Nov 18 21:56:15 1990
  1217. ***************
  1218. *** 24,33 ****
  1219. --- 24,35 ----
  1220.   #include <xview/text.h>
  1221.   #include <xview/defaults.h>
  1222.   #include <xview/notice.h>
  1223. + #include <xview/font.h>
  1224.   #include "xv_ui.h"
  1225.   #include "spider.bm"
  1226.   
  1227.   int defaultHelpDir = FALSE;
  1228. + extern Bool squish;
  1229.   
  1230.   /*
  1231.    * Create object `BackUpMenu' in the specified instance.
  1232. ***************
  1233. *** 362,379 ****
  1234.       return obj;
  1235.   }
  1236.   
  1237. ! void
  1238. ! set_help_label(win, name)
  1239. !     Xv_opaque win;
  1240. !     char    *name;
  1241. ! {
  1242. !     char    *buf;
  1243.   
  1244. -     buf = malloc(strlen(name) + 8);
  1245. -     sprintf(buf, "%s Help", name);
  1246. -     xv_set(win, XV_LABEL, buf, 0);
  1247. - }
  1248.   /*
  1249.    * Initialize an instance of object `subwindow1'.
  1250.    */
  1251. --- 364,381 ----
  1252.       return obj;
  1253.   }
  1254.   
  1255. ! /*
  1256. !  * define the help window strings, subwindow1
  1257. !  */
  1258. ! #define    HELP_STR_CATS        "Categories:"
  1259. ! #define HELP_STR_INTRO        "Introduction"
  1260. ! #define HELP_STR_RULES        "Rules"
  1261. ! #define HELP_STR_CNTRLS        "Controls"
  1262. ! #define HELP_STR_EXS        "Examples"
  1263. ! #define HELP_STR_MISC        "Extras"
  1264. ! #define HELP_STR_SUM        "Summary"
  1265. ! #define HELP_STR_DISMISS    "Dismiss"
  1266.   
  1267.   /*
  1268.    * Initialize an instance of object `subwindow1'.
  1269.    */
  1270. ***************
  1271. *** 392,429 ****
  1272.           return (spider_subwindow1_objects *) NULL;
  1273.       }
  1274.       obj->window2 = spider_popup_create(ip, owner);
  1275. -     set_help_label(obj->window2, ip->defaults->instanceName);
  1276.       obj->controls2 = xv_get(obj->window2, FRAME_CMD_PANEL);
  1277. !     obj->button8 = spider_button_create(ip, obj->controls2,
  1278. !         "Intro", subhelp_handler);
  1279. !     xv_set(obj->button8, XV_KEY_DATA, HELPKEY, HELP_INTRO,
  1280.           0);
  1281. -     obj->button9 = spider_button_create(ip, obj->controls2,
  1282. -         "Rules", subhelp_handler);
  1283. -     xv_set(obj->button9, XV_KEY_DATA, HELPKEY, HELP_RULES,
  1284. -         0);
  1285. -     obj->button10 = spider_button_create(ip, obj->controls2,
  1286. -         "Controls", subhelp_handler);
  1287. -     xv_set(obj->button10, XV_KEY_DATA, HELPKEY, HELP_CNTRLS,
  1288. -         0);
  1289. -     obj->button11 = spider_button_create(ip, obj->controls2,
  1290. -         "Examples", subhelp_handler);
  1291. -     xv_set(obj->button11, XV_KEY_DATA, HELPKEY, HELP_EXS,
  1292. -         0);
  1293. -     obj->button12 = spider_button_create(ip, obj->controls2,
  1294. -         "Extras", subhelp_handler);
  1295. -     xv_set(obj->button12, XV_KEY_DATA, HELPKEY, HELP_MISC,
  1296. -         0);
  1297. -     obj->button13 = spider_button_create(ip, obj->controls2,
  1298. -                 "Summary", subhelp_handler);
  1299. -         xv_set(obj->button13, XV_KEY_DATA, HELPKEY, HELP_SUM,
  1300. -                 0);
  1301. -     obj->button14 = spider_button_create(ip, obj->controls2,
  1302. -         "Dismiss", help_done_handler);
  1303. -     xv_set(obj->button14, 
  1304. -         XV_X, (int) xv_get(obj->button14, XV_X) + 
  1305. -             (int) xv_get(obj->button14, XV_WIDTH),
  1306. -         0);
  1307.       window_fit_height(obj->controls2);
  1308.       obj->textsw1 = spider_subwindow1_textsw1_create(ip, obj->window2);
  1309.   
  1310. --- 394,421 ----
  1311.           return (spider_subwindow1_objects *) NULL;
  1312.       }
  1313.       obj->window2 = spider_popup_create(ip, owner);
  1314.       obj->controls2 = xv_get(obj->window2, FRAME_CMD_PANEL);
  1315. !     obj->categoryChoice = xv_create(obj->controls2, PANEL_CHOICE,
  1316. !         XV_KEY_DATA, INSTANCE, ip,
  1317. !         PANEL_CHOOSE_ONE, TRUE,
  1318. !         PANEL_LABEL_STRING, HELP_STR_CATS,
  1319. !         PANEL_CHOICE_STRINGS,
  1320. !             HELP_STR_INTRO, 
  1321. !             HELP_STR_RULES,
  1322. !             HELP_STR_CNTRLS,
  1323. !             HELP_STR_EXS,
  1324. !             HELP_STR_MISC,
  1325. !             HELP_STR_SUM,
  1326. !             NULL,
  1327. !         PANEL_VALUE, 0,
  1328. !         PANEL_NOTIFY_PROC, subhelp_handler,
  1329. !         NULL);
  1330. !     obj->dismissButton = spider_button_create(ip, obj->controls2,
  1331. !         HELP_STR_DISMISS, help_done_handler);
  1332. !     xv_set(obj->dismissButton, 
  1333. !         XV_X, (int)xv_get(obj->dismissButton, XV_X) + 
  1334. !             ((int)xv_get(obj->dismissButton, XV_WIDTH) / 2),
  1335.           0);
  1336.       window_fit_height(obj->controls2);
  1337.       obj->textsw1 = spider_subwindow1_textsw1_create(ip, obj->window2);
  1338.   
  1339. ***************
  1340. *** 484,489 ****
  1341. --- 476,482 ----
  1342.       extern char *helpDir;
  1343.       extern char *instanceName;
  1344.       extern char *resourceFile;
  1345. +     extern int squish;
  1346.   
  1347.       if (obj != (spider_defaults_objects *)NULL ){
  1348.                   return obj;
  1349. ***************
  1350. *** 508,513 ****
  1351. --- 501,509 ----
  1352.       obj->roundCards = round_cards = 
  1353.           defaults_get_boolean(buf1, "RoundCards", TRUE);
  1354.   #endif
  1355. +     sprintf(buf1,"%s.%s", obj->instanceName, "squish");
  1356. +     obj->squish = squish =
  1357. +         defaults_get_boolean(buf1, "Squish", TRUE);
  1358.       sprintf(buf1,"%s.%s", obj->instanceName, "deltaMod");
  1359.       obj->deltaMod = deltamod = 
  1360.           defaults_get_integer(buf1, "DeltaMod", 1);
  1361. ***************
  1362. *** 518,529 ****
  1363.       sprintf(buf1,"%s.%s", obj->instanceName, "helpDir");
  1364.       s = (char *)defaults_get_string(buf1, "HelpDir", (char *)NULL);
  1365.       if (s == (char *)NULL) {
  1366. !         obj->helpDir = helpDir;
  1367. !     } else {
  1368. !         obj->helpDir = malloc(strlen(s) + 1);
  1369. !         sprintf(obj->helpDir, "%s", s);
  1370. !         helpDir = obj->helpDir;
  1371.       }
  1372.       return(obj);
  1373.   }
  1374.   
  1375. --- 514,542 ----
  1376.       sprintf(buf1,"%s.%s", obj->instanceName, "helpDir");
  1377.       s = (char *)defaults_get_string(buf1, "HelpDir", (char *)NULL);
  1378.       if (s == (char *)NULL) {
  1379. !         s = helpDir;
  1380.       }
  1381. +     /*
  1382. +      * Do some checking around for help files if not already found
  1383. +      */
  1384. +     if (!helpfiles_exist(s)) {
  1385. +         char *helphome;
  1386. +         extern char *getenv();
  1387. +         if (((helphome = getenv("OPENWINHOME")) ||
  1388. +              (helphome = getenv("XVIEWHOME"))) &&
  1389. +              (helphome != (char *)NULL)) {
  1390. +             sprintf(buf1,"%s/lib/help/spider",helphome);
  1391. +             if (helpfiles_exist(buf1)) {
  1392. +                 s = buf1;
  1393. +             } 
  1394. +         } 
  1395. +     }
  1396. +     obj->helpDir = malloc(strlen(s) + 1);
  1397. +     sprintf(obj->helpDir, "%s", s);
  1398. +     free(helpDir);
  1399. +     helpDir = obj->helpDir;
  1400. +                 
  1401.       return(obj);
  1402.   }
  1403.   
  1404. ***************
  1405. *** 540,545 ****
  1406. --- 553,574 ----
  1407.   }
  1408.   
  1409.   /*
  1410. +  * strings used in the properties panel, subwindow2.
  1411. +  */
  1412. + #define    PROPS_BELL        "Use audible bell to notify:"
  1413. + #define PROPS_REPLAY        "Replay Time (in microseconds):"
  1414. + #define PROPS_ROUND        "Use rounded edges on cards:"
  1415. + #define PROPS_NOTICE        "Use notice to verify deletion of data:"
  1416. + #define PROPS_STACK        "Stack contiguous cards of the same suit:"
  1417. + #define PROPS_DELTA        "Spacing of cards relative to board size:"
  1418. + #define PROPS_VISIBLE        "Characters visible in text fields:"
  1419. + #define PROPS_HELPDIR        "Help Directory:"
  1420. + #define PROPS_APPLY        "Apply"
  1421. + #define PROPS_SAVE        "Apply & Save"
  1422. + #define PROPS_RESET        "Reset"
  1423. + #define PROPS_DISMISS        "Dismiss"
  1424. + /*
  1425.    * Initialize an instance of object `subwindow2'.
  1426.    */
  1427.   spider_subwindow2_objects *
  1428. ***************
  1429. *** 550,558 ****
  1430.       char *buf;
  1431.   
  1432.       spider_subwindow2_objects *obj = ip->subwindow2;
  1433. !     int row=1, width, bwidth;
  1434.       extern void     props_done_handler(), props_apply_handler(), 
  1435. !         props_reset_handler();
  1436.   
  1437.       if (obj != (spider_subwindow2_objects *)NULL ){
  1438.           return obj;
  1439. --- 579,588 ----
  1440.       char *buf;
  1441.   
  1442.       spider_subwindow2_objects *obj = ip->subwindow2;
  1443. !     int row=1, width, bwidth, space, basex, mplw, w[10], i;
  1444. !     Panel_item pitem;
  1445.       extern void     props_done_handler(), props_apply_handler(), 
  1446. !         props_apply_save_handler(), props_reset_handler();
  1447.   
  1448.       if (obj != (spider_subwindow2_objects *)NULL ){
  1449.           return obj;
  1450. ***************
  1451. *** 565,571 ****
  1452.       obj->controls3 = xv_get(obj->window3, FRAME_CMD_PANEL);
  1453.       xv_set(obj->controls3, XV_HELP_DATA, "spider:props.panel", 0);
  1454.       obj->choice1 = spider_boolean_choice_create(ip, obj->controls3, 
  1455. !         "Use audible bell to notify:");
  1456.       xv_set(obj->choice1,
  1457.           XV_X, xv_cols(obj->controls3, 1),
  1458.           XV_Y, xv_rows(obj->controls3, row++),
  1459. --- 595,601 ----
  1460.       obj->controls3 = xv_get(obj->window3, FRAME_CMD_PANEL);
  1461.       xv_set(obj->controls3, XV_HELP_DATA, "spider:props.panel", 0);
  1462.       obj->choice1 = spider_boolean_choice_create(ip, obj->controls3, 
  1463. !         PROPS_BELL);
  1464.       xv_set(obj->choice1,
  1465.           XV_X, xv_cols(obj->controls3, 1),
  1466.           XV_Y, xv_rows(obj->controls3, row++),
  1467. ***************
  1468. *** 574,583 ****
  1469.           0);
  1470.       obj->numtext1 = spider_subwindow2_numtext1_create(ip, obj->controls3, 
  1471.           row++);
  1472. !     xv_set(obj->numtext1, XV_HELP_DATA, "spider:replayTime", 0);
  1473.   #ifdef ROUND_CARDS
  1474.       obj->choice2 = spider_boolean_choice_create(ip, obj->controls3,
  1475. !         "Use round cards:");
  1476.       xv_set(obj->choice2, 
  1477.                   XV_X, xv_cols(obj->controls3, 1), 
  1478.                   XV_Y, xv_rows(obj->controls3, row++), 
  1479. --- 604,615 ----
  1480.           0);
  1481.       obj->numtext1 = spider_subwindow2_numtext1_create(ip, obj->controls3, 
  1482.           row++);
  1483. !     xv_set(obj->numtext1, 
  1484. !         XV_HELP_DATA, "spider:replayTime", 
  1485. !         0);
  1486.   #ifdef ROUND_CARDS
  1487.       obj->choice2 = spider_boolean_choice_create(ip, obj->controls3,
  1488. !         PROPS_ROUND);
  1489.       xv_set(obj->choice2, 
  1490.                   XV_X, xv_cols(obj->controls3, 1), 
  1491.                   XV_Y, xv_rows(obj->controls3, row++), 
  1492. ***************
  1493. *** 586,592 ****
  1494.                   0);
  1495.   #endif
  1496.       obj->choice3 = spider_boolean_choice_create(ip, obj->controls3,
  1497. !                 "Use notice to verify deletion of data:");
  1498.           xv_set(obj->choice3,
  1499.                   XV_X, xv_cols(obj->controls3, 1),
  1500.                   XV_Y, xv_rows(obj->controls3, row++),
  1501. --- 618,624 ----
  1502.                   0);
  1503.   #endif
  1504.       obj->choice3 = spider_boolean_choice_create(ip, obj->controls3,
  1505. !                 PROPS_NOTICE);
  1506.           xv_set(obj->choice3,
  1507.                   XV_X, xv_cols(obj->controls3, 1),
  1508.                   XV_Y, xv_rows(obj->controls3, row++),
  1509. ***************
  1510. *** 593,600 ****
  1511.                   PANEL_VALUE, ip->defaults->confirm,
  1512.           XV_HELP_DATA, "spider:confirm",
  1513.                   0);
  1514.       obj->slider1 = spider_slider_create(ip, obj->controls3, 
  1515. !         "Delta Modification:", 0, 30, 15);
  1516.       xv_set(obj->slider1, 
  1517.                   XV_X, xv_cols(obj->controls3, 1), 
  1518.                   XV_Y, xv_rows(obj->controls3, row++), 
  1519. --- 625,640 ----
  1520.                   PANEL_VALUE, ip->defaults->confirm,
  1521.           XV_HELP_DATA, "spider:confirm",
  1522.                   0);
  1523. +     obj->choice4 = spider_boolean_choice_create(ip, obj->controls3,
  1524. +         PROPS_STACK);
  1525. +     xv_set(obj->choice4, 
  1526. +                 XV_X, xv_cols(obj->controls3, 1), 
  1527. +                 XV_Y, xv_rows(obj->controls3, row++), 
  1528. +                 PANEL_VALUE, ip->defaults->squish,
  1529. +         XV_HELP_DATA, "spider:squish",
  1530. +                 0);
  1531.       obj->slider1 = spider_slider_create(ip, obj->controls3, 
  1532. !         PROPS_DELTA, 0, 30, 15);
  1533.       xv_set(obj->slider1, 
  1534.                   XV_X, xv_cols(obj->controls3, 1), 
  1535.                   XV_Y, xv_rows(obj->controls3, row++), 
  1536. ***************
  1537. *** 602,608 ****
  1538.           XV_HELP_DATA, "spider:deltaMod",
  1539.                   0);
  1540.       obj->slider2 = spider_slider_create(ip, obj->controls3, 
  1541. !         "Characters visible in text fields:", 8, 45, 20);
  1542.       xv_set(obj->slider2,
  1543.           XV_X, xv_cols(obj->controls3, 1),
  1544.                   XV_Y, xv_rows(obj->controls3, row++),
  1545. --- 642,648 ----
  1546.           XV_HELP_DATA, "spider:deltaMod",
  1547.                   0);
  1548.       obj->slider2 = spider_slider_create(ip, obj->controls3, 
  1549. !         PROPS_VISIBLE, 8, 45, 20);
  1550.       xv_set(obj->slider2,
  1551.           XV_X, xv_cols(obj->controls3, 1),
  1552.                   XV_Y, xv_rows(obj->controls3, row++),
  1553. ***************
  1554. *** 610,616 ****
  1555.           XV_HELP_DATA, "spider:textField",
  1556.                   0);
  1557.       obj->textfield2 = spider_textfield_create(ip, obj->controls3, 
  1558. !         "Help Directory:");
  1559.       xv_set(obj->textfield2,
  1560.           XV_X, xv_cols(obj->controls3, 1),
  1561.           XV_Y, xv_rows(obj->controls3, row++),
  1562. --- 650,656 ----
  1563.           XV_HELP_DATA, "spider:textField",
  1564.                   0);
  1565.       obj->textfield2 = spider_textfield_create(ip, obj->controls3, 
  1566. !         PROPS_HELPDIR);
  1567.       xv_set(obj->textfield2,
  1568.           XV_X, xv_cols(obj->controls3, 1),
  1569.           XV_Y, xv_rows(obj->controls3, row++),
  1570. ***************
  1571. *** 617,646 ****
  1572.           PANEL_VALUE, ip->defaults->helpDir,
  1573.           XV_HELP_DATA, "spider:helpDir",
  1574.           0);
  1575.       window_fit_width(obj->controls3);
  1576.       width = xv_get(obj->controls3, XV_WIDTH);
  1577.       obj->button15 = spider_button_create(ip, obj->controls3,
  1578. !         "Apply", props_apply_handler);
  1579.       obj->button16 = spider_button_create(ip, obj->controls3,
  1580. !         "Reset", props_reset_handler);
  1581.       obj->button17 = spider_button_create(ip, obj->controls3,
  1582. !         "Dismiss", props_done_handler);
  1583.       bwidth = ((int)xv_get(obj->button15, XV_WIDTH) + 
  1584.           (int)xv_get(obj->button16, XV_WIDTH) + 
  1585. !         (int)xv_get(obj->button17, XV_WIDTH))/3;
  1586.       xv_set(obj->button15,
  1587.           XV_Y, xv_rows(obj->controls3, ++row),
  1588. !         XV_X, (width - 5*bwidth) / 2,
  1589.           XV_HELP_DATA, "spider:props.apply",
  1590.           0);
  1591.       xv_set(obj->button16,
  1592.           XV_Y, xv_rows(obj->controls3, row),
  1593. !         XV_X, (width - 5*bwidth) / 2 + 2*bwidth,
  1594.                   XV_HELP_DATA, "spider:props.reset", 
  1595.           0);
  1596.       xv_set(obj->button17,
  1597.           XV_Y, xv_rows(obj->controls3, row),
  1598. !         XV_X, (width - 5*bwidth) / 2 + 4*bwidth,
  1599.                   XV_HELP_DATA, "spider:props.dismiss", 
  1600.           0);
  1601.       window_fit_height(obj->controls3);
  1602. --- 657,717 ----
  1603.           PANEL_VALUE, ip->defaults->helpDir,
  1604.           XV_HELP_DATA, "spider:helpDir",
  1605.           0);
  1606. +     /* 
  1607. +      * right justify the panel labels along the ":" 
  1608. +      */
  1609. +     mplw = 0; i = 0;
  1610. +     PANEL_EACH_ITEM(obj->controls3, pitem)
  1611. +         mplw = ( mplw > (w[i]=(int)xv_get(pitem, PANEL_LABEL_WIDTH))) ?
  1612. +             mplw : w[i];
  1613. +         i++;
  1614. +     PANEL_END_EACH
  1615. +     mplw = mplw + xv_cols(obj->controls3, 1);
  1616. +     i = 0;
  1617. +     PANEL_EACH_ITEM(obj->controls3, pitem)
  1618. +         xv_set(pitem, PANEL_LABEL_X, mplw - w[i], NULL);
  1619. +         i++;
  1620. +     PANEL_END_EACH
  1621. +     /*
  1622. +      * fit the panel to width of items and then create bottom buttons
  1623. +      */
  1624.       window_fit_width(obj->controls3);
  1625.       width = xv_get(obj->controls3, XV_WIDTH);
  1626.       obj->button15 = spider_button_create(ip, obj->controls3,
  1627. !         PROPS_APPLY, props_apply_handler);
  1628. !     obj->button18 = spider_button_create(ip, obj->controls3,
  1629. !         PROPS_SAVE, props_apply_save_handler);
  1630.       obj->button16 = spider_button_create(ip, obj->controls3,
  1631. !         PROPS_RESET, props_reset_handler);
  1632.       obj->button17 = spider_button_create(ip, obj->controls3,
  1633. !         PROPS_DISMISS, props_done_handler);
  1634.       bwidth = ((int)xv_get(obj->button15, XV_WIDTH) + 
  1635. +         (int)xv_get(obj->button18, XV_WIDTH) + 
  1636.           (int)xv_get(obj->button16, XV_WIDTH) + 
  1637. !         (int)xv_get(obj->button17, XV_WIDTH))/4;
  1638. !     space = 2*(int)xv_get(xv_get(obj->controls3,WIN_FONT),FONT_CHAR_WIDTH);
  1639. !     basex = (width - (4*bwidth + 3*space)) / 2;
  1640.       xv_set(obj->button15,
  1641.           XV_Y, xv_rows(obj->controls3, ++row),
  1642. !         XV_X, basex,
  1643.           XV_HELP_DATA, "spider:props.apply",
  1644.           0);
  1645. +     basex = basex + (int)xv_get(obj->button15, XV_WIDTH) + space;
  1646. +     xv_set(obj->button18,
  1647. +         XV_Y, xv_rows(obj->controls3, row),
  1648. +         XV_X, basex, 
  1649. +         XV_HELP_DATA, "spider:props.apply_save",
  1650. +         0);
  1651. +     basex = basex + (int)xv_get(obj->button18, XV_WIDTH) + space;
  1652.       xv_set(obj->button16,
  1653.           XV_Y, xv_rows(obj->controls3, row),
  1654. !         XV_X, basex,
  1655.                   XV_HELP_DATA, "spider:props.reset", 
  1656.           0);
  1657. +     basex = basex + (int)xv_get(obj->button16, XV_WIDTH) + space;
  1658.       xv_set(obj->button17,
  1659.           XV_Y, xv_rows(obj->controls3, row),
  1660. !         XV_X, basex,
  1661.                   XV_HELP_DATA, "spider:props.dismiss", 
  1662.           0);
  1663.       window_fit_height(obj->controls3);
  1664. ***************
  1665. *** 685,691 ****
  1666.           XV_X, xv_cols(owner, 1),
  1667.           XV_Y, xv_rows(owner, row),    
  1668.                   PANEL_LAYOUT, PANEL_HORIZONTAL,
  1669. !         PANEL_LABEL_STRING, "Replay Time (in microseconds):",
  1670.           PANEL_MIN_VALUE, 20,
  1671.           PANEL_MAX_VALUE, 20000,
  1672.           PANEL_VALUE_DISPLAY_LENGTH, 6,
  1673. --- 756,762 ----
  1674.           XV_X, xv_cols(owner, 1),
  1675.           XV_Y, xv_rows(owner, row),    
  1676.                   PANEL_LAYOUT, PANEL_HORIZONTAL,
  1677. !         PANEL_LABEL_STRING, PROPS_REPLAY,
  1678.           PANEL_MIN_VALUE, 20,
  1679.           PANEL_MAX_VALUE, 20000,
  1680.           PANEL_VALUE_DISPLAY_LENGTH, 6,
  1681.  
  1682. *** xv_ui.h    Sat Apr 28 14:52:57 1990
  1683. --- ../1.1/xv_ui.h    Sun Nov 18 19:31:44 1990
  1684. ***************
  1685. *** 25,31 ****
  1686.   #define HELP_MAX    6
  1687.   
  1688.   #ifndef SPIDER_DEFAULTS
  1689. ! #define SPIDER_DEFAULTS    ".spiderrc"
  1690.   #endif
  1691.   
  1692.   #ifndef HELPDIR
  1693. --- 25,31 ----
  1694.   #define HELP_MAX    6
  1695.   
  1696.   #ifndef SPIDER_DEFAULTS
  1697. ! #define SPIDER_DEFAULTS    ".Xdefaults"
  1698.   #endif
  1699.   
  1700.   #ifndef HELPDIR
  1701. ***************
  1702. *** 39,51 ****
  1703.   typedef struct {
  1704.           Xv_opaque       window2;
  1705.           Xv_opaque       controls2;
  1706. !         Xv_opaque       button8;
  1707. !         Xv_opaque       button9;
  1708. !         Xv_opaque       button10;
  1709. !         Xv_opaque       button11;
  1710. !         Xv_opaque       button12;
  1711. !         Xv_opaque       button13;
  1712. !         Xv_opaque       button14;
  1713.           Xv_opaque       textsw1;
  1714.   } spider_subwindow1_objects;
  1715.   
  1716. --- 39,46 ----
  1717.   typedef struct {
  1718.           Xv_opaque       window2;
  1719.           Xv_opaque       controls2;
  1720. !         Xv_opaque       categoryChoice;
  1721. !         Xv_opaque       dismissButton;
  1722.           Xv_opaque       textsw1;
  1723.   } spider_subwindow1_objects;
  1724.   
  1725. ***************
  1726. *** 62,70 ****
  1727. --- 57,67 ----
  1728.       Xv_opaque    slider2;
  1729.       Xv_opaque    textfield2;
  1730.       Xv_opaque    textfield3;
  1731. +     Xv_opaque    choice4;
  1732.           Xv_opaque       button15;
  1733.           Xv_opaque       button16;
  1734.           Xv_opaque       button17;
  1735. +         Xv_opaque       button18;
  1736.   } spider_subwindow2_objects;
  1737.   
  1738.   typedef struct {
  1739. ***************
  1740. *** 78,83 ****
  1741. --- 75,81 ----
  1742.       int    textField;
  1743.       char    *helpDir;
  1744.       char    *instanceName;
  1745. +     Bool    squish;
  1746.   } spider_defaults_objects;
  1747.   
  1748.   typedef struct {
  1749.  
  1750. dan
  1751. ----------------------------------------------------
  1752. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1753. Opinions expressed reflect those of the author only.
  1754. --
  1755. dan
  1756. ----------------------------------------------------
  1757. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1758. Opinions expressed reflect those of the author only.
  1759.